// 管理员登录接口
const express = require('express');
const router = express.Router();
const db = require('../../db/connect');
const jwt = require('jsonwebtoken')
const xzid = require('xzid')

router.get('/auth/button', (req, res) => {

    // 传入参数 账户、密码
    const { id } = req.query;
    const sql = `SELECT manger_router.button
    from manger_router
    INNER JOIN manger_admin ON manger_admin.type = manger_router.type
    WHERE manger_admin.admin_id = ?  `;
    db(sql ,[id],(err, data) => {
        if (data.length>0) {
           res.send({
                data

           })
        } else {
            res.send({
                code: 400,
                content: err,
                message: '告诉他账户不存在'
            })
        }
    })
})
module.exports = router